package LcOthers;

import java.util.Scanner;
public class RomanNumber {
    public static void main(String[] args)
    {
        String[] thousands = {"","M","MM","MM"};
        String[] hundreds  = {"", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM"};
        String[] tens      = {"", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC"};
        String[] ones      = {"", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"};

        Scanner scan=new Scanner(System.in);
        System.out.println("请输入一个整数");
        int n=scan.nextInt();
        int []array=new int [10];
        int j=0;
        while(n>0)
        {
            array[j++]=(n%10);
            n/=10;
        }
        StringBuffer roman=new StringBuffer();
        roman.append(thousands[array[3]]);
        roman.append(hundreds[array[2]]);
        roman.append(tens[array[1]]);
        roman.append(ones[array[0]]);
        
        
        System.out.println(roman);
            
        scan.close();

    }
}
